/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.ope.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 *
 * @author infzt
 */
@Entity
@Table(name = "OPE_BOVEDA", catalog = "SIGEMFI", schema = "dbo", uniqueConstraints = {@UniqueConstraint(columnNames = {"FID_OPE_VENTANILLA"})})
@NamedQueries({@NamedQuery(name = "Boveda.findAll", query = "SELECT b FROM Boveda b"), @NamedQuery(name = "Boveda.findByIdBoveda", query = "SELECT b FROM Boveda b WHERE b.idBoveda = :idBoveda"), @NamedQuery(name = "Boveda.findByHoraCierre", query = "SELECT b FROM Boveda b WHERE b.horaCierre = :horaCierre"), @NamedQuery(name = "Boveda.findByHoraApertura", query = "SELECT b FROM Boveda b WHERE b.horaApertura = :horaApertura"), @NamedQuery(name = "Boveda.findByResultado", query = "SELECT b FROM Boveda b WHERE b.resultado = :resultado"), @NamedQuery(name = "Boveda.findByDiferencia", query = "SELECT b FROM Boveda b WHERE b.diferencia = :diferencia"), @NamedQuery(name = "Boveda.findByMontoArqueado", query = "SELECT b FROM Boveda b WHERE b.montoArqueado = :montoArqueado"), @NamedQuery(name = "Boveda.findByDetalle", query = "SELECT b FROM Boveda b WHERE b.detalle = :detalle"), @NamedQuery(name = "Boveda.findByCodigo", query = "SELECT b FROM Boveda b WHERE b.codigo = :codigo")})
public class Boveda implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_BOVEDA", nullable = false)
    private Long idBoveda;
    @Column(name = "HORA_CIERRE", length = 10)
    private String horaCierre;
    @Column(name = "HORA_APERTURA", length = 10)
    private String horaApertura;
    @Column(name = "RESULTADO")
    private Integer resultado;
    @Column(name = "DIFERENCIA")
    private Integer diferencia;
    @Column(name = "MONTO_ARQUEADO")
    private Integer montoArqueado;
    @Column(name = "DETALLE", length = 100)
    private String detalle;
    @Column(name = "CODIGO", length = 50)
    private String codigo;
    @JoinColumn(name = "FID_OPE_VENTANILLA", referencedColumnName = "ID_VENTANILLA", nullable = false)
    @OneToOne(optional = false, fetch = FetchType.LAZY)
    private Ventanilla fidOpeVentanilla;

    public Boveda() {
    }

    public Boveda(Long idBoveda) {
        this.idBoveda = idBoveda;
    }

    public Long getIdBoveda() {
        return idBoveda;
    }

    public void setIdBoveda(Long idBoveda) {
        this.idBoveda = idBoveda;
    }

    public String getHoraCierre() {
        return horaCierre;
    }

    public void setHoraCierre(String horaCierre) {
        this.horaCierre = horaCierre;
    }

    public String getHoraApertura() {
        return horaApertura;
    }

    public void setHoraApertura(String horaApertura) {
        this.horaApertura = horaApertura;
    }

    public Integer getResultado() {
        return resultado;
    }

    public void setResultado(Integer resultado) {
        this.resultado = resultado;
    }

    public Integer getDiferencia() {
        return diferencia;
    }

    public void setDiferencia(Integer diferencia) {
        this.diferencia = diferencia;
    }

    public Integer getMontoArqueado() {
        return montoArqueado;
    }

    public void setMontoArqueado(Integer montoArqueado) {
        this.montoArqueado = montoArqueado;
    }

    public String getDetalle() {
        return detalle;
    }

    public void setDetalle(String detalle) {
        this.detalle = detalle;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public Ventanilla getFidOpeVentanilla() {
        return fidOpeVentanilla;
    }

    public void setFidOpeVentanilla(Ventanilla fidOpeVentanilla) {
        this.fidOpeVentanilla = fidOpeVentanilla;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBoveda != null ? idBoveda.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Boveda)) {
            return false;
        }
        Boveda other = (Boveda) object;
        if ((this.idBoveda == null && other.idBoveda != null) || (this.idBoveda != null && !this.idBoveda.equals(other.idBoveda))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.ope.be.Boveda[idBoveda=" + idBoveda + "]";
    }

}
